<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>人力成本 - 消防工程集团经营管理系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            background: #f3f4f6;
        }
    </style>
</head>
<body>
    <!-- Sidebar -->
    <div class="fixed left-0 top-0 bottom-0 w-64 bg-gray-900 text-white shadow-lg">
        <div class="p-6 border-b border-gray-800">
            <div class="flex items-center">
                <i class="fas fa-fire-extinguisher text-2xl text-blue-400 mr-3"></i>
                <div>
                    <div class="font-bold text-lg">消防工程集团</div>
                    <div class="text-xs text-gray-400">管理系统</div>
                </div>
            </div>
        </div>
        <nav class="p-4 space-y-2">
            <a href="dashboard.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-chart-line w-5 mr-3"></i>
                <span>数据看板</span>
            </a>
            <a href="project-list.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-building w-5 mr-3"></i>
                <span>项目管理</span>
            </a>
            <a href="purchase-list.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-shopping-cart w-5 mr-3"></i>
                <span>采购管理</span>
            </a>
            <a href="payment-list.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-money-bill-wave w-5 mr-3"></i>
                <span>付款管理</span>
            </a>
            <a href="inventory.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-warehouse w-5 mr-3"></i>
                <span>库存管理</span>
            </a>
            <a href="hr-dashboard.html" class="flex items-center px-4 py-3 bg-blue-600 rounded-lg text-white">
                <i class="fas fa-users w-5 mr-3"></i>
                <span>人力成本</span>
            </a>
            <a href="system-settings.html" class="flex items-center px-4 py-3 text-gray-300 hover:bg-gray-800 rounded-lg">
                <i class="fas fa-cog w-5 mr-3"></i>
                <span>系统管理</span>
            </a>
        </nav>
    </div>

    <!-- Main Content -->
    <div class="ml-64">
        <header class="bg-white shadow-sm border-b border-gray-200 px-8 py-4">
            <div class="flex items-center justify-between">
                <h1 class="text-2xl font-bold text-gray-800">人力成本看板</h1>
                <div class="flex items-center gap-3">
                    <select class="border border-gray-300 rounded-lg px-4 py-2">
                        <option>2024年1月</option>
                        <option>2023年12月</option>
                    </select>
                </div>
            </div>
        </header>

        <!-- Summary Cards -->
        <div class="grid grid-cols-4 gap-6 p-8">
            <div class="bg-white rounded-lg shadow-sm p-4 border-l-4 border-blue-500">
                <div class="text-sm text-gray-600 mb-1">员工总数</div>
                <div class="text-2xl font-bold text-blue-600">156</div>
                <div class="text-xs text-gray-500 mt-1">人</div>
            </div>
            <div class="bg-white rounded-lg shadow-sm p-4 border-l-4 border-green-500">
                <div class="text-sm text-gray-600 mb-1">本月薪资支出</div>
                <div class="text-2xl font-bold text-green-600">¥1,200,000</div>
                <div class="text-xs text-gray-500 mt-1">较上月 +5%</div>
            </div>
            <div class="bg-white rounded-lg shadow-sm p-4 border-l-4 border-orange-500">
                <div class="text-sm text-gray-600 mb-1">平均出勤率</div>
                <div class="text-2xl font-bold text-orange-600">95.7%</div>
                <div class="text-xs text-gray-500 mt-1">较上月 +2.1%</div>
            </div>
            <div class="bg-white rounded-lg shadow-sm p-4 border-l-4 border-purple-500">
                <div class="text-sm text-gray-600 mb-1">项目人力投入</div>
                <div class="text-2xl font-bold text-purple-600">128</div>
                <div class="text-xs text-gray-500 mt-1">人·天</div>
            </div>
        </div>

        <!-- Charts -->
        <div class="grid grid-cols-2 gap-6 px-8 pb-8">
            <div class="bg-white rounded-lg shadow-sm p-6">
                <h3 class="text-lg font-semibold text-gray-800 mb-4">薪资支出趋势</h3>
                <canvas id="salaryTrendChart" height="250"></canvas>
            </div>
            <div class="bg-white rounded-lg shadow-sm p-6">
                <h3 class="text-lg font-semibold text-gray-800 mb-4">出勤率统计</h3>
                <canvas id="attendanceChart" height="250"></canvas>
            </div>
        </div>

        <!-- Project HR Cost -->
        <div class="px-8 pb-8">
            <div class="bg-white rounded-lg shadow-sm p-6">
                <h3 class="text-lg font-semibold text-gray-800 mb-4">各项目人力成本</h3>
                <table class="w-full">
                    <thead class="bg-gray-50">
                        <tr>
                            <th class="px-4 py-3 text-left text-xs font-semibold text-gray-600">项目名称</th>
                            <th class="px-4 py-3 text-left text-xs font-semibold text-gray-600">投入人数</th>
                            <th class="px-4 py-3 text-left text-xs font-semibold text-gray-600">人力成本</th>
                            <th class="px-4 py-3 text-left text-xs font-semibold text-gray-600">占比</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-200">
                        <tr>
                            <td class="px-4 py-3 text-sm text-gray-900">消防工程A项目</td>
                            <td class="px-4 py-3 text-sm text-gray-700">25人</td>
                            <td class="px-4 py-3 text-sm font-semibold text-gray-900">¥450,000</td>
                            <td class="px-4 py-3 text-sm text-gray-700">37.5%</td>
                        </tr>
                        <tr>
                            <td class="px-4 py-3 text-sm text-gray-900">消防工程B项目</td>
                            <td class="px-4 py-3 text-sm text-gray-700">30人</td>
                            <td class="px-4 py-3 text-sm font-semibold text-gray-900">¥500,000</td>
                            <td class="px-4 py-3 text-sm text-gray-700">41.7%</td>
                        </tr>
                        <tr>
                            <td class="px-4 py-3 text-sm text-gray-900">消防工程C项目</td>
                            <td class="px-4 py-3 text-sm text-gray-700">15人</td>
                            <td class="px-4 py-3 text-sm font-semibold text-gray-900">¥250,000</td>
                            <td class="px-4 py-3 text-sm text-gray-700">20.8%</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <script>
        // Salary Trend Chart
        const salaryCtx = document.getElementById('salaryTrendChart').getContext('2d');
        new Chart(salaryCtx, {
            type: 'line',
            data: {
                labels: ['8月', '9月', '10月', '11月', '12月', '1月'],
                datasets: [{
                    label: '薪资支出',
                    data: [1100, 1150, 1180, 1200, 1150, 1200],
                    borderColor: '#3b82f6',
                    backgroundColor: 'rgba(59, 130, 246, 0.1)',
                    tension: 0.4
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false
            }
        });

        // Attendance Chart
        const attCtx = document.getElementById('attendanceChart').getContext('2d');
        new Chart(attCtx, {
            type: 'bar',
            data: {
                labels: ['子公司A', '子公司B', '子公司C'],
                datasets: [{
                    label: '出勤率',
                    data: [96.5, 95.2, 94.8],
                    backgroundColor: ['#10b981', '#3b82f6', '#f59e0b']
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                scales: {
                    y: {
                        beginAtZero: true,
                        max: 100
                    }
                }
            }
        });
    </script>
</body>
</html>

